package pl.SilverSable.Engine.physic;

import com.badlogic.gdx.math.Circle;
import com.badlogic.gdx.math.Intersector;
import com.badlogic.gdx.math.Rectangle;

public class Colision {

	public static boolean IsColision(Rectangle Rec1, Rectangle Rec2)
	{		
		return Intersector.intersectRectangles(Rec1, Rec2);		
	}
	public static boolean IsCollision(Circle circle1, Circle circle2){
	    double xDiff = circle2.x - circle1.x;
	    double yDiff = circle2.y - circle1.y;

	    double distance = Math.sqrt((Math.pow(xDiff, 2) + Math.pow(yDiff, 2)));
	    if(  distance < (circle2.radius + circle1.radius))
	    {
	    	return true;
	    }
	    else
	    {
	    	return false;
	    }	   	    
	}
}
